package com.example.demo.controller;

import com.example.demo.dto.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test")
public class WebController {
    @GetMapping("/get")
    public String testGet(@RequestParam("id") String id) {
        return "test ok" + id;
    }

    @GetMapping("/post")
    public String testPost(User user) {
        return user.getUsername();
    }

}